package com.ssy.lingxi.marketing.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 每次砍价类型：1-随机金额 2-固定金额
 * @author yzc
 * @version 2.0.0
 * @date 2021/10/29
 */
public enum ActivityStrPoolEnum {

    //[1,10]分隔符
    comma_zh (1,"，"),
    semicolon_zh (2,"；"),

    //[11,40]===================商品的活动标签activityTag===================
    specialOffer_at (11,"特价"),
    plummet_at (12,"直降"),
    discount_at (13,"{}折"),
    full_quantity_reduction_at (14,"满量减"),
    full_quantity_discount_at (15,"满量折"),
    full_money_pt_reduction_at (16,"跨店满减"),
    full_money_pt_discount_at (17,"跨店满折"),
    full_money_at_reduction_at (18,"满额减"),
    full_money_at_discount_at (19,"满额折"),
    give_goods_at (20,"赠品"),
    give_coupon_at (21,"返券"),
    morePiece_at (22,"第{}件{}折"),
    combination_at (23,"{}元场"),
    groupPurchase_at (24,"拼团"),
    bargain_at (25,"砍价"),
    swap_at (26,"换购"),
    secKill_at (27,"秒杀"),
    pre_sell_at (28,"预售"),
    setMeal_at (29,"套餐"),
    attempt_at (30,"试用"),

    //[41,80]===================商品活动优惠标签preferentialTag===================
    specialOffer_pt (41,"特价"),
    plummet_pt (42,"直降"),
    discount_pt (43,"直降{}折"),
    full_quantity_reduction_pt (44,"满量减"),
    full_quantity_discount_pt (45,"满量折"),
    full_money_pt_reduction_pt (46,"跨店满减"),
    full_money_pt_discount_pt (47,"跨店满折"),
    full_money_at_reduction_pt (48,"满额减"),
    full_money_at_discount_pt (49,"满额折"),
    give_goods_pt (50,"赠品"),
    give_coupon_pt (51,"返券"),
    morePiece_pt (52,"多买优惠"),
    combination_pt (53,"{}元场"),
    groupPurchase_pt (54,"拼团"),
    bargain_pt (55,"砍价"),
    swap_pt (56,"换购"),
    secKill_pt (57,"限时秒杀"),
    pre_sell_pt (58,"预售"),
    setMeal_pt (59,"套餐"),
    attempt_pt (60,"试用"),

    //[81,120]===================商品活动优惠标签描述preferentialTagDesc===================
    specialOffer_ptd (81,"活动截止：{}，抢购抓紧"),
    plummet_ptd (82,"活动截止：{}，抢购抓紧"),
    discount_ptd (83,"活动截止：{}，抢购抓紧"),
    full_quantity_reduction_ptd (84,"满{}件，总价减{}元"),
    full_quantity_discount_ptd (85,"满{}件，总价打{}折"),
    full_money_reduction_ptd (86,"满{}元，减{}元"),
    full_money_discount_ptd (87,"满{}元，打{}折"),
    give_goods_ptd_full_money_1 (88,"满{}元赠"),
    give_goods_ptd_full_money_2 (89,"{}{}件"),
    give_coupon_ptd_full_money_1 (90,"满{}元返"),
    give_coupon_ptd_full_money_2 (91,"{}{}张"),
    give_goods_ptd_buy_goods_1 (92,"购买{}件赠"),
    give_goods_ptd_buy_goods_2 (93,"{}{}件"),
    give_coupon_ptd_buy_goods_1 (94,"购买{}件返"),
    give_coupon_ptd_buy_goods_2 (95,"{}{}张"),
    morePiece_ptd (96,"第{}件{}折"),
    combination_ptd (97,"{}元{}件"),
    groupPurchase_ptd (98,"{}人团"),
    swap_full_money_ptd (99,"满{}元可优惠换购{}"),
    swap_buy_goods_ptd (100,"购买{}件可优惠换购{}"),
    secKill_ptd (101,"活动截止：{}，抢购抓紧"),
    secKill_ptd2 (102,"{} 开抢"),

    //[121,130]===================活动描述===================
    specialOffer_desc (121,"以下商品限时特价，抓紧抢购"),
    plummet_desc (122,"以下商品限时直降，抓紧抢购"),
    discount_desc (123,"以下商品限时折扣，抓紧抢购");

    private final Integer code;
    private final String message;

    ActivityStrPoolEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public static String getMessage(Integer code) {
        return Arrays.stream(ActivityStrPoolEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().map(ActivityStrPoolEnum::getMessage).orElse("");
    }


}
